import { defineAmisPlugin, getInputTpl } from '../../base/util';
import CommonCount, { type IProps } from './fc';

export default defineAmisPlugin<IProps>(({ amisEditor }) => {
  const { getSchemaTpl } = amisEditor;

  return {
    component: CommonCount,
    options: {
      type: 'portal-resource-custom-count',
      name: '一体化资源平台汇总',
      icon: 'SlidersOutlined',
      description: '一体化资源平台汇总',
      panelTitle: '一体化资源平台汇总面板',
      scaffold: {
        title: '一体化资源平台汇总汇总',
      },
      panelTabs: [
        {
          title: '常规',
          body: [
            getSchemaTpl('collapseGroup', [
              {
                title: '基本',
                body: [
                  getInputTpl('urlPath', { label: '路径' }),
                  getInputTpl('urlParams', { label: '参数' }),
                  getInputTpl('showGroup', { label: '展示模块' }),
                  {
                    name: 'showList',
                    label: '展示字段',
                    type: 'input-array',
                    value: [],
                    inline: true,
                    items: {
                      type: 'input-text',
                      clearable: false,
                    },
                  },
                  {
                    name: 'pathList',
                    label: '跳转设置',
                    type: 'input-array',
                    value: [],
                    inline: true,
                    items: {
                      type: 'input-text',
                      clearable: false,
                    },
                  },
                ],
              },
              // getApiTpl(),
            ]),
          ],
        },
        {
          title: '外观',
          body: [
            getSchemaTpl('collapseGroup', [
              ...getSchemaTpl('theme:common', { styleName: 'style' }),
            ]),
          ],
        },
      ],
    },
  };
});
